package cn.kgc.jjl.workhome;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class PersonTest02 {
	
	public static void main(String[] args) throws IOException, Exception {
		 //反序列化
		FileInputStream fis = new FileInputStream("d:/a.txt");
		ObjectInputStream ois = new ObjectInputStream(fis);
		//读取对象
		 Object obj =ois.readObject();
		
		//向下转型
		Person per = (Person) obj;
		 
		 //关闭资源
		System.out.println(per);
		ois.close();
		fis.close();
	
	}

}
